﻿<local:BaseSourceContentFrame x:Class="InfFront.InfoViews.WPF.SingleEditWithToolbarFrame"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:InfFront.InfoViews.WPF"
    Height="Auto" Width="Auto" MinWidth="300" MinHeight="300"
    >

    <UserControl.Resources>
        <local:IconedObjectToNormal24x24ImageConverter x:Key="getNormal24x24Image"/>
    </UserControl.Resources>

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="50" MinHeight="50" />
            <RowDefinition MinHeight="100" />
        </Grid.RowDefinitions>

        <WrapPanel Grid.Row="0" Name="pnlCommands">
            <ItemsControl x:Name="commandsControlList" Padding="4" VerticalContentAlignment="Center">
                <ItemsControl.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel VerticalAlignment="Center" Orientation="Horizontal" />
                    </ItemsPanelTemplate>
                </ItemsControl.ItemsPanel>
                <ItemsControl.ItemTemplate>
                    <DataTemplate>
                        <Button Focusable="False" Margin="4" 
                                Click="CommandButton_Click" VerticalAlignment="Center"
                                IsEnabled="{Binding Path=IsEnabled}"
                                ToolTip="{Binding Path=Comment}"
                                >
                            <Button.Background>
                                <SolidColorBrush Color="{Binding Path=VisualSettings.CommandButtonColor, FallbackValue=Azure}" />
                            </Button.Background>
                            <WrapPanel>
                                <Image Width="24" Height="24" Source="{Binding Converter={StaticResource getNormal24x24Image}}"/>
                                <TextBlock Margin="4" Text="{Binding Path=Title}" VerticalAlignment="Center" />                        
                            </WrapPanel>
                        </Button>
                    </DataTemplate>
                </ItemsControl.ItemTemplate>
            </ItemsControl>
        </WrapPanel>

        <local:SingleEntryFrame Grid.Row="1" x:Name="currentEntryFrame" Width="Auto" Height="Auto" />        
        
    </Grid>
</local:BaseSourceContentFrame>
